/*
 * Copyright (c) zhg2yqq.com Corp.
 * All Rights Reserved.
 */
package com.zhg2yqq.wheels.log;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.zhg2yqq.wheels.log.aop.OperationLogAspect;
import com.zhg2yqq.wheels.log.service.DefaultOperationLogService;
import com.zhg2yqq.wheels.log.service.IOperationLogService;

/**
 * @author zhg2yqq, 2022年11月30日
 * @version zhg2yqq v1.0
 */
@Configuration
public class OperationLogConfiguration {
    @Bean
    @ConditionalOnMissingBean(IOperationLogService.class)
    public IOperationLogService operationLogService() {
        return new DefaultOperationLogService();
    }

    @Bean
    public OperationLogAspect operationLogAspect(IOperationLogService operationLogService) {
        return new OperationLogAspect(operationLogService);
    }
}
